package top.duorhs.jspider.constant;

/**
 * 构造MarkDown文件
 *
 * @author Duorhs
 * @date 2023/1/11 9:44
 */
public class MarkDownUtil {
    public static final String MD_LINE = "- ";

    public static final String MD_IMG = "![]()";

    private static StringBuilder sb = null;

    /**
     * 构造MarkDown的段落格式
     *
     * @param content 文本内容
     * @return MD段落
     */
    public static String buildMdLine(String content) {
        sb = new StringBuilder(MD_LINE);
        sb.append(content);
        return sb.toString();
    }

    /**
     * 构造MarkDown的图片路径格式
     *
     * @param content 图片url路径
     * @return MD图片
     */
    public static String buildMdImg(String content) {
        sb = new StringBuilder(MD_IMG);
        sb.insert(4, content);
        return sb.toString();
    }
}
